package test.aop.assist;

import javassist.util.proxy.ProxyFactory;

/**
 * javassist用来简化动态代理, 突破了只能用接口的限制
 * 而且内部使用了字节码增强实现，在性能上还也要比原生jdk高出很多
 */
public class Main {
    public static void main(String[] args) throws Exception {
        ProxyFactory proxyFactory = new ProxyFactory();
        proxyFactory.setSuperclass(Student.class);
        ProxyCheckWork proxy = new ProxyCheckWork(new Student());
        Student student = (Student) proxyFactory.create(new Class<?>[0], new Object[0], proxy);
        student.login();
    }
}
